const path=require('path')
const HtmlWebpackPlugin=require('html-webpack-plugin')
const htmlPlugin=new HtmlWebpackPlugin({
	template:'./src/index.html',
	filename:'index.html'
})
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports={
	mode:'development',//production
	entry:path.join(__dirname,'./src/index.js'),//入口文件
	output:{
		path:path.join(__dirname,'./dist'),
		filename:'bundle.js'
	},
	plugins:[htmlPlugin,new VueLoaderPlugin()],
	module:{
		rules:[
		{ test: /\.vue$/, loader: 'vue-loader' } ,
		{test:/\.js$/,use:'babel-loader',exclude:/node_modules/},
		{test:/\.css$/,use:['style-loader','css-loader','postcss-loader']},
			{test:/\.jpg|png|gif|bmp|ttf|eot|svg|woff|woff2$/,
				use:'url-loader?limit=69999'
			},
		{test:/\.less$/,use:['style-loader','css-loader']},
		{test:/\.scss$/,use:['style-loader','css-loader','sass-loader']}
		]
	}
}
